package com.cxg.allsys.adminsys.controller;

import com.cxg.allsys.adminsys.service.IAdminService;
import com.cxg.allsys.adminsys.service.impl.AdminService;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/Administration")
@Data
@Slf4j
@CrossOrigin
public class AdminController {
    @Autowired
    private IAdminService adminService;
    //系统管理员登录
    @RequestMapping("/CheckLoginSysUser")
    @ApiOperation(value = "系统管理员登录",notes = "系统管理员登录")
        public String CheckLoginSysUser(String userName,String password) {
        log.info("CheckLoginSysUser系统管理员=控制器运行CheckLoginSysUser方法");
        boolean flag = adminService.qure(userName, password);
        log.info("打印返回值："+flag);
        if (flag) {
            return "true";
        } else {
            return "false";
        }
    }
}
